<?php
class UserActiveRecord extends CActiveRecord
{
    private $_db;
    public function getDbConnection(){
        if(!$this->_db){
            $this->_db = Yii::app()->dbUser;
            $this->_db->setActive(true);
        }
        return $this->_db;
    }

}